package com.zhiche.lisa.bms.service.quote;

import com.baomidou.mybatisplus.service.IService;
import com.zhiche.lisa.bms.dao.model.contract.Contract;
import com.zhiche.lisa.bms.dao.model.quote.QuoteDtl;
import com.zhiche.lisa.bms.pojo.bo.quote.FleetQuotation;
import com.zhiche.lisa.bms.pojo.vo.quote.QuoteExpandVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 报价单明细 服务类
 * </p>
 *
 * @author liuanshun
 * @since 2018-10-22
 */
public interface QuoteDtlService extends IService<QuoteDtl> {
    /**
     * 根据条件查询报价单详明
     *
     * @param condition
     * @return
     */
    List<QuoteDtl> selectQuoteDtlList(Map<String, Object> condition);

    /**
     * 根据条件查询报价单详明
     *
     * @param condition
     * @return
     */
    List<QuoteDtl> selectQuoteDtlListNoTenant(Map<String, Object> condition);

    /**
     * 根据headerId获取报价单详明
     *
     * @param id
     * @return
     */
    List<QuoteDtl> selectQuoteDtlsByHeaderId(Long id);

    /**
     * 根据headerId获取报价单详明
     *
     * @param ids
     * @return
     */
    List<QuoteDtl> selectQuoteDtlsByHeaderIds(List<Long> ids);

    /**
     * 根据报价单头单id修改应付账款的合同信息，并同时生成预付账单
     *
     * @param contract
     * @param headerId
     */
    void updateFeePayableContactByHeaderId(Contract contract, Long headerId);

    /**
     * 根据详细数据和头id进行新增
     *
     * @param quoteDtls
     * @param headerId
     * @return
     */
    List<QuoteDtl> insertQuotesBySourceAndHeaderId(List<QuoteDtl> quoteDtls, Long headerId);

    /**
     * 批量更新报价信息
     *
     * @param quoteDtls
     * @return
     */
    List<QuoteDtl> updateQuotes(List<QuoteDtl> quoteDtls);

    /**
     * 根据详细数据和头id进行编辑
     *
     * @param quoteDtls
     * @param headerId
     * @return
     */
    List<QuoteDtl> editQuotesBySourceAndHeaderId(List<QuoteDtl> quoteDtls, Long headerId);

    /**
     * 根据条件报价单规则明细
     *
     * @param condition
     * @return
     */
    List<FleetQuotation> selectFleetQuotation(Map<String, Object> condition);

    /**
     * 获取明细数据
     *
     * @param quoteId
     * @return
     */
    List<QuoteExpandVO> getQuoteExpandByQuoteId(Long quoteId);

    /**
     * 批量获取明细数据
     *
     * @param quoteIdList
     * @return
     */
    List<QuoteExpandVO> getQuoteExpandByQuoteIdList(List<Long> quoteIdList);

}
